(highlight_trailing_whitespace): On character terminals,
authorGerd Moellmann <gerd@gnu.org>
Wed, 14 Mar 2001 13:26:13 +0000 (13:26 +0000)
committerGerd Moellmann <gerd@gnu.org>
Wed, 14 Mar 2001 13:26:13 +0000 (13:26 +0000)
skip the padding blanks inserted in extend_face_to_end_of_line,
before checking for trailing whitespace.

src/xdisp.c

index 314ba0ac06fd913b21bbbc561f20e34039804cfa..ef54efc19759d1a4962223bebead13081856362c 100644 (file)
@@ -12252,11 +12252,13 @@ highlight_trailing_whitespace (f, row)
       struct glyph *start = row->glyphs[TEXT_AREA];
       struct glyph *glyph = start + used - 1;
 
-      /* Skip over the space glyph inserted to display the
-        cursor at the end of a line.  */
-      if (glyph->type == CHAR_GLYPH
-         && glyph->u.ch == ' '
-         && INTEGERP (glyph->object))
+      /* Skip over space glyphs inserted to display the cursor at the
+        end of a line, and for extending the face of the last glyph
+        to the end of the line on terminals.  */
+      while (glyph >= start
+            && glyph->type == CHAR_GLYPH
+            && glyph->u.ch == ' '
+            && INTEGERP (glyph->object))
        --glyph;
 
       /* If last glyph is a space or stretch, and it's trailing